package com.doublethread.easymart.common.exception;

import com.doublethread.easymart.common.result.ResultCode;

/**
 * 文件上传异常工具类
 */
public class FileException {

    /**
     * 文件上传失败异常
     */
    public static void uploadFailed() {
        throw new BusinessException(ResultCode.FILE_UPLOAD_FAILED);
    }

    /**
     * 文件类型不支持异常
     */
    public static void typeNotAllowed() {
        throw new BusinessException(ResultCode.FILE_TYPE_NOT_ALLOWED);
    }

    /**
     * 文件大小超出限制异常
     */
    public static void sizeExceeded() {
        throw new BusinessException(ResultCode.FILE_SIZE_EXCEEDED);
    }
}